#pragma once

#include <QtWidgets/QWidget>
#include <QTimer>
#include "ui_Home.h"

class HomeWnd : public QWidget
{
	Q_OBJECT

public:
	HomeWnd(QWidget *parent = nullptr);
	~HomeWnd() = default;

	void SetCabinetName(const QString& name);
    inline void SetVersion(const QString& version) {
        ui.lb_version->setText(tr("%1").arg(version));
    }

protected:
	bool eventFilter(QObject *watched, QEvent *event) override;

protected slots:
    void on_edt_card_no_returnPressed();
    void on_btnd_back_clicked();

    void event_numpad_key_clicked(const QString& key);
    void event_numpad_ok_clicked();
    void event_numpad_del_clicked();

signals:
	void depositEvent();
	void fetchEvent();
	void infoEvent();
	void cardLogin(QString cardno);

private:
	Ui::Home ui;

    QTimer timer_;
};
